package com.turtle3d;

import java.io.PrintStream;

import com.turtle3d.gui.console.Console;

public abstract class App{

	private static Console console;
	private static PrintStream printStream = System.out;
	
	private static void println(String message){
		
		printStream.println(message);
		
		if(console!=null)
			console.println(message, Console.INFO);
		
	}
	
	public static void println(Object message){
		println(message.toString(), Console.INFO);
	}
	
	public static void printlnError(Object message){
		println(message.toString(), Console.ERROR);
	}
	
	public static void printlnWarning(Object message){
		println(message.toString(), Console.WARNING);
	}
	
	public static void println(Object message, int type){
		printStream.println(message);
		
		if(console!=null)
			console.println(message.toString(), type);
	}

	public static Console getConsole() {
		return console;
	}

	public static void setConsole(Console console) {
		App.console = console;
	}
	

}
